import 'dart:async';

Future<String> _testFuture({bool error = true}) async {
  if (error) throw AssertionError("assert error2");
  return "a";
}

main() {
  _testTryCatch();

  _testLate();
}

Future<void> _testTryCatch() async {
  try {
    final res = _testFuture();
    print(res);
  } catch (e) {
    print("try-catch error: ${e.toString()}");
  }
}

late String a;

late Student s;

late int number;

void _testLate() {
  a = "a";
  print(a);
  a = "111";
  print(a);
  a = "222";
  print(a);

  s = Student("name1", 1);
  print(s.toString());
  s = Student("name2", 2);
  print(s.toString());
  s = Student("name3", 3);
  print(s.toString());

  number = 1;
  print(number);
  number = 2;
  print(number);
  number = 3;
  print(number);
}

class Student {
  final String name;
  final int age;

  Student(this.name, this.age);

  @override
  String toString() {
    return 'Student{name: $name, age: $age}';
  }
}
